﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Forums.OfflineStore;
using Microsoft.Forums.ForumsProvider;

namespace Microsoft.Forums.ForumsClient.Models
{
    /// <summary>
    /// Login Status of the user.
    /// </summary>
    public enum LogOnStatus { Offline, Authenticated };

    /// <summary>
    /// User LogOn Information. This is a pure data model.
    /// </summary>
    public class UserLogOnInformation : BindableObject
    {
        /// <summary>
        /// Details of the loggedin user
        /// </summary>
        DetailedUser userInfo;

        /// <summary>
        ///  Hold the current user login status.
        /// </summary>
        private LogOnStatus logonStatus = LogOnStatus.Offline;

        /// <summary>
        /// Constructor sets all members to String.Empty
        /// </summary>
        public UserLogOnInformation()
        {
      
        }

        /// <summary>
        /// Gets or sets the user info.
        /// </summary>
        /// <value>The user info.</value>
        public DetailedUser UserInfo
        {
            get
            {
                return userInfo;
            }
            set
            {
                if (value != UserInfo)
                {
                    userInfo = value;
                    OnPropertyChanged("UserInfo");
                }
            }
        }

        /// <summary>
        /// gets/sets user's login name
        /// </summary>
        public string LogOnName
        {
            get;
            set;
        }

        /// <summary>
        /// Gets/Sets user's authentication ticket 
        /// </summary>
        public string AuthenticationTicket
        {
            get;
            set;
        }

        /// <summary>
        ///  LogOnState of the user. Autheticated or Offline.
        /// </summary>
        public LogOnStatus LogOnState
        {
            get
            {
                return logonStatus;
            }
            set
            {
                logonStatus = value;
                OnPropertyChanged("LogOnState");
            }
        }
    }
}
